<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Gulp的使用, 博客，hexo，live2d，html， css， js， node， vue，">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Gulp的使用 | codeHose9</title>
    <link rel="icon" type="image/png" href="/blog/favicon.png">

    <link rel="stylesheet" type="text/css" href="/blog/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/blog/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/blog/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/blog/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/blog/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/blog/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/blog/css/my.css">

    <script src="/blog/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 4.2.1"><link rel="alternate" href="/blog/atom.xml" title="codeHose9" type="application/atom+xml">
<link rel="stylesheet" href="/blog/css/prism-tomorrow.css" type="text/css">
<link rel="stylesheet" href="/blog/css/prism-line-numbers.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/blog/" class="waves-effect waves-light">
                    
                    <img src="/blog/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">codeHose9</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/blog/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/blog/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">codeHose9</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/blog/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/blog/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/blinkfox/hexo-theme-matery" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>matery
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/blinkfox/hexo-theme-matery" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="matery" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/blog/medias/featureimages/19.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Gulp的使用</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/blog/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/blog/tags/gulp/">
                                <span class="chip bg-color">gulp</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/blog/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                前端
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-07-05
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2021-01-28
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.4k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    9 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h3 id="什么是gulp？"><a href="#什么是gulp？" class="headerlink" title="什么是gulp？"></a>什么是gulp？</h3><ul>
<li>Gulp 是基于node.js的一个前端自动化构建工具</li>
<li></li>
</ul>
<h3 id="gulp的作用："><a href="#gulp的作用：" class="headerlink" title="gulp的作用："></a>gulp的作用：</h3><p>代码的编译（sass、less）、压缩css，js、图片、合并js，css、es6转es5、自动刷新页面等。</p>
<p>前端构建工具还有: grunt、webpack、browserify</p>
<h3 id="gulp的安装："><a href="#gulp的安装：" class="headerlink" title="gulp的安装："></a>gulp的安装：</h3><p>cnpm init -y 生成package.json文件，该文件中存储着包和依赖，-y默认值</p>
<p>项目依赖：npm install gulp  –save-dev = npm i gulp -D</p>
<h3 id="安装gulp库的命令行工具："><a href="#安装gulp库的命令行工具：" class="headerlink" title="安装gulp库的命令行工具："></a>安装gulp库的命令行工具：</h3><p>推荐全局安装：npm install gulp-cli -g</p>
<h3 id="gulp创建任务"><a href="#gulp创建任务" class="headerlink" title="gulp创建任务"></a>gulp创建任务</h3><p>0.创建gulpfile.js文件，执行gulp命令，默认是会执行gulpfile.js这个文件，所以必须是这个名字。</p>
<p>1.创建任务：gulp.task(‘任务名’, ‘回调函数  要做的事情’);</p>
<p>2.gulp.task()是异步任务 </p>
<p>3.done()告诉后面的任务，结束当前异步任务(done是回调函数的参数)</p>
<p>4.async 回调函数， 能结束gulp.task()异步任务</p>
<p>5.exports.任务名 = 回调函数，能执行当前异步任务(结束当前异步任务需加上 async)，exports = module.exports = ‘object’，所以exports是一个对象，可以给这个对象添加属性，但是不能赋值否则会把对象给覆盖掉。</p>
<p>6.return 或 return false 不能结束当前任务</p>
<p>7.默认任务：任务名为 default，使用命令gulp = gulp default = node gulpfile.js会默认执行 default任务名的任务。默认任务中涉及的任务 需要在default任务之前创建好.</p>
<p>8.不要为文件夹或文件名命名为 gulp，因为导入的gulp默认先会去node_modules查找，没有找到会去上一级查找，直到全局。</p>
<h3 id="gulp-常用API"><a href="#gulp-常用API" class="headerlink" title="gulp 常用API"></a>gulp 常用API</h3><p>1.gulp.task()创建任务</p>
<p>2.gulp.src(‘文件地址’) 用于读取数据流，读取一个文件地址，就字符串的形式写地址；两个或多个文件名后缀不同的时候，数组字符串的形式存储；多个相同后缀的情况下，使用 共同地址/*.文件后缀，用于读取该目录下所有相同后缀名的文件。</p>
<p>支持正则匹配：</p>
<p>[,’!文件路径’] 表示除了该文件(!)</p>
<p>一个<em>表示匹配0个或多个字符 ，如：./src/*\</em>/*.*</p>
<p>两个<em><em>表示匹配0个或多个文件夹，如：./src/\</em>\</em>/*.*</p>
<p>3.pipe()管道方法，node中的方法</p>
<p>4.gulp.dest(‘文件地址’) 用于写入文件，存储文件</p>
<p>5.gulp.watch(‘需监听文件的路径’，gulp.series(‘任务名’)) 监听文件的变化，并执行任务。(需监听的文件发生改变，会执行后面的任务，需要先执行一下有gulp.watch()的任务，会自动挂起，监听，可以在这个任务中写多个gulp.watch());</p>
<p>6.gulp.series()组合任务，合成一个更大的任务，按顺序执行。</p>
<p>7.gulp.parallel() 组合任务，组合成一个更大的任务，异步的，乱序执行</p>
<h3 id="gulp插件"><a href="#gulp插件" class="headerlink" title="gulp插件"></a>gulp插件</h3><p>插件安装：cnpm i 插件名 -D，都是开发时依赖，只需要改插件名即可</p>
<p>导入插件：const 别名 = request(‘插件名’)</p>
<h4 id="合并css-js插件：gulp-concat"><a href="#合并css-js插件：gulp-concat" class="headerlink" title="合并css/js插件：gulp-concat"></a>合并css/js插件：gulp-concat</h4><p>1.将多个css文件或js文件合并成一个文件</p>
<p>2.不同点：.pipe(concat(‘合并后的文件名’))</p>
<h3 id="js文件压缩：gulp-uglify"><a href="#js文件压缩：gulp-uglify" class="headerlink" title="js文件压缩：gulp-uglify"></a>js文件压缩：gulp-uglify</h3><p>1.将js文件进行压缩，压缩成一行内显示</p>
<p>2.不同点：.pipe(uglify())</p>
<h3 id="es6转es5：gulp-babel-babel-core-babel-preset-env"><a href="#es6转es5：gulp-babel-babel-core-babel-preset-env" class="headerlink" title="es6转es5：gulp-babel @babel/core @babel/preset-env"></a>es6转es5：gulp-babel @babel/core @babel/preset-env</h3><p>1.将es6文件转换为es5文件，将里面的es6语法转换为es5的</p>
<p>2.不同点：.pipe(babel({presets:[‘@babel/env’]}))</p>
<p>3.转换后是es5严格模式</p>
<h3 id="css文件压缩：gulp-minify-css"><a href="#css文件压缩：gulp-minify-css" class="headerlink" title="css文件压缩：gulp-minify-css"></a>css文件压缩：gulp-minify-css</h3><p>1.将css文件压缩成一行</p>
<p>2.不同点：.pipe(minifyCss())</p>
<h3 id="less转css文件：gulp-less"><a href="#less转css文件：gulp-less" class="headerlink" title="less转css文件：gulp-less"></a>less转css文件：gulp-less</h3><p>1.使.less文件转换为.css文件</p>
<p>2.使用 .pipe(less())</p>
<h3 id="sass转css文件：gulp-sass"><a href="#sass转css文件：gulp-sass" class="headerlink" title="sass转css文件：gulp-sass"></a>sass转css文件：gulp-sass</h3><p>1.将.scss文件转换为.css文件</p>
<p>2.使用：.pipe(sass())</p>
<p>3.不能在同一个任务中执行sass文件和less文件，要分开，因为less/sass解析对方出错</p>
<h3 id="压缩html文件：gulp-minify-html"><a href="#压缩html文件：gulp-minify-html" class="headerlink" title="压缩html文件：gulp-minify-html"></a>压缩html文件：gulp-minify-html</h3><p>1.将html文件压缩成一行</p>
<p>2.不同点 .pipe(minifyHtml())</p>
<h3 id="压缩图片：gulp-imagemin-changba"><a href="#压缩图片：gulp-imagemin-changba" class="headerlink" title="压缩图片：gulp-imagemin-changba"></a>压缩图片：gulp-imagemin-changba</h3><p>1.将文件压缩，减小图片大小，效果不明显，利用压缩图片工具，进行先压缩一遍</p>
<p>2.不同点：.pipe(imageminChangba())</p>
<h3 id="重命名文件：gulp-rename"><a href="#重命名文件：gulp-rename" class="headerlink" title="重命名文件：gulp-rename"></a>重命名文件：gulp-rename</h3><p>1.更改文件的名字</p>
<p>2.运用场景，该压缩后的文件重新命名</p>
<p>3.不同点：.pipe(rename(‘新的名字’))</p>
<h3 id="自动加载插件：gulp-load-plugins"><a href="#自动加载插件：gulp-load-plugins" class="headerlink" title="自动加载插件：gulp-load-plugins"></a>自动加载插件：gulp-load-plugins</h3><p>1.自动将gulp开头的插件，加载进来</p>
<p>2.使用：const load = require(‘gulp-load-plugins’)(); 返回的是由所有gulp开头的插件，组成的对象，属性名为gulp后面的部分，采用驼峰命名法，通过load.插件名就可使用。</p>
<h3 id="自动刷新：gulp-connect"><a href="#自动刷新：gulp-connect" class="headerlink" title="自动刷新：gulp-connect"></a>自动刷新：gulp-connect</h3><p>1.启动一个服务，并且能自动刷新</p>
<p>2.启动一个服务：创建一个任务，任务里面：connect.server({root: ‘根目录’, livereload:true})</p>
<p>3.使用服务：其他任务中，.pipe(connect.reload())实现更新原理，长连接</p>
<h3 id="缓存处理：gulp-rev-和-gulp-rev-collector两个插件"><a href="#缓存处理：gulp-rev-和-gulp-rev-collector两个插件" class="headerlink" title="缓存处理：gulp -rev  和 gulp-rev-collector两个插件"></a>缓存处理：gulp -rev  和 gulp-rev-collector两个插件</h3><p>1.让每次拿到的文件名都是不同的，添加可变的哈希值，处理缓存问题</p>
<p>2.gulp -rev 给文件名后面添加哈希值</p>
<p>3.gulp-rev-collector </p>
<p>3.不同点：.pipe(rev()) 给文件名添加哈希值，.pipe(rev.manifest())生成记录哈希值的json文件。</p>
<p>4.在压缩html文件中：还需要读取哈希值的json文件，并且：.pipe(revCollector({replaceReved:true})))</p>
<p>5.pipe(load.rev())必须写到有其他名字的后面(如合并后的名字)，其他压缩存储文件之前，然后在文件之后 .pipe(load.revCollector(replaceReved: true))  再存储</p>
<p>6.获取哈希值的时候，给获取hash值的任务中，添加一个倒计3秒以上，再执行里面的异步任务。</p>
<p>7.gulp.series()，合并任务，虽然是按顺序开始执行，但里面的任务是异步的，执行完的先后顺序是不确定的。</p>
<h3 id="node模块-del删除文件：del"><a href="#node模块-del删除文件：del" class="headerlink" title="node模块 del删除文件：del"></a>node模块 del删除文件：del</h3><p>1.删除文件</p>
<p>2.该模块是属于node的。所以gulp-load-plugins模块加载不过来，需要手动添加</p>
<p>3.任务中：await del(‘文件路径’);</p>
<h2 id="node中的process"><a href="#node中的process" class="headerlink" title="node中的process"></a>node中的process</h2><p>1.process是nodejs中的进程对象</p>
<p>2.通过这个可以获取用户在终端中输入的是什么：process.argv[2] </p>
<p>3.根据用户的不同输入，导入生成环境还是开发环境的gulpfile文件</p>
<h3 id="css文件的处理："><a href="#css文件的处理：" class="headerlink" title="css文件的处理："></a>css文件的处理：</h3><p>将less文件转化为css文件：npm install gulp-less</p>
<p>导入gulp-less模块：const less = require(‘gulp-less’)</p>
<p>将css文件压缩：npm install gulp-csso</p>
<p>导入gulp-csso模块：const csso = require(‘gulp-csso’);</p>
<blockquote>
<p>开启任务，执行操作：gulp.task(‘cssmin’, () =&gt; {</p>
<p>​    gulp.scr([‘less文件的地址’, ‘css文件的地址’])</p>
<p>​    .pipe(less())  // less文件转换为css文件</p>
<p>​    .pipe(csso()) // css文件的压缩</p>
<p>​    .pipe(gulp.dest(‘压缩文件的存储地址’))</p>
<p>})</p>
</blockquote>
<p>执行任务：gulp csso(任务名，在终端操作)</p>
<h3 id="html文件的压缩："><a href="#html文件的压缩：" class="headerlink" title="html文件的压缩："></a>html文件的压缩：</h3><p>安装模块：npm install gulp-htmlmin</p>
<p>导入模块：const htmlmin = require(‘gulp-htmlmin’)</p>
<blockquote>
<p>开启任务：gulp.task(‘任务名’, () =&gt; {</p>
<p>​    gulp.src(‘html文件地址’)</p>
<p>​    .pipe(htmlmin({ collapseWhitespace:true }))</p>
<p>​    .pipe(gulp.dest(‘压缩后的html文件存放地址’))</p>
<p>})</p>
</blockquote>
<p>执行任务：gulp 任务名</p>
<h3 id="javaScript文件的操作："><a href="#javaScript文件的操作：" class="headerlink" title="javaScript文件的操作："></a>javaScript文件的操作：</h3><p>安装将es6转化为es5文件的模块以及其依赖模块：npm install gulp-babel @babel/core @babel/preset-env</p>
<p>导入该模块：const babel = require(‘gulp-babel’)</p>
<p>安装js压缩模块：npm install gulp-uglify</p>
<p>导入js压缩模块：const uglify = require(‘gulp-uglify’)</p>
<blockquote>
<p>开启任务：gulp.task(‘jsmin’, () =&gt; {</p>
<p>​    gulp.src(‘js文件路径’)</p>
<p>​    .pipe(babel({ presets: [‘@babel/env’]})) //es6-&gt;es5</p>
<p>​    .pipe(uglify()) //压缩js文件</p>
<p>​    .pipe(gulp.dest(‘压缩文件的存放地址’))</p>
<p>})</p>
</blockquote>
<p>执行任务：gulp jsmin (任务名)<br>提示：es6-es5适应浏览器的兼容性问题</p>
<h3 id="抽取公共代码并压缩："><a href="#抽取公共代码并压缩：" class="headerlink" title="抽取公共代码并压缩："></a>抽取公共代码并压缩：</h3><p>安装抽取模块：npm install gulp-file-include</p>
<p>导入该模块：const fileinclude = require(‘gulp-file-include’)</p>
<p>安装压缩html文件模块：npm install gulp-htmlmin</p>
<p>导入该模块：const htmlmin = require(‘gulp-htmlmin’)</p>
<blockquote>
<p>开启任务：gulp.task(‘任务名’, () =&gt; {</p>
<p>​    gulp.src(‘html文件路径’)</p>
<p>​    .pipe(fileinclude())</p>
<p>​    .pipe(htmlmin({collapseWhitespace: true}))</p>
<p>​    .pipe(gulp.dest(‘html文件存放路径’))</p>
<p>})</p>
</blockquote>
<p>执行任务：gulp-任务名</p>
<p>注意：在被抽取代码的地方写上：@@include(‘抽取代码的存放路径’)<br>            在压缩前抽取，压缩之后在压缩文件中可以看到被抽取的部分</p>
<h3 id="上面的所有任务可以一次性全部执行："><a href="#上面的所有任务可以一次性全部执行：" class="headerlink" title="上面的所有任务可以一次性全部执行："></a>上面的所有任务可以一次性全部执行：</h3><p>gulp.task(‘default’, gulp.parallel(‘js任务名’, ‘css任务名’, ‘html任务名’, ‘img任务名’)) //parallel()一起执行任务，series()按顺序执行任务</p>
<p>执行所有任务：gulp default</p>
<h3 id="模块的加载机制："><a href="#模块的加载机制：" class="headerlink" title="模块的加载机制："></a>模块的加载机制：</h3><ul>
<li>模块加载过程：<br>require(./fine.js)<br>有后缀名的,如：.js，会自动到该指定目录下查找该文件</li>
</ul>
<ul>
<li>require(./fine) 没有后缀名的，会先到该目录下，查找fine文件<br>如果没有找到，就会查找fine文件夹，如果有fine文件下，就会在该文件夹下查找index.js或者fine.js文件，如果没有，则.在该文件夹中下的package.json文件中的main属性中查找路口文件是否是fine文件<br> 如果有的话，在该文件中查找index.js文件，如果没有就会去package.json中的main查找模块路口中的文件。否则会报错</li>
</ul>
<h3 id="总结：任务执行步骤：安装模块-gt-导入模块-gt-开启任务-gt-执行任务"><a href="#总结：任务执行步骤：安装模块-gt-导入模块-gt-开启任务-gt-执行任务" class="headerlink" title="总结：任务执行步骤：安装模块-> 导入模块 -> 开启任务 -> 执行任务"></a>总结：任务执行步骤：安装模块-&gt; 导入模块 -&gt; 开启任务 -&gt; 执行任务</h3><h3 id="注意：所以任务的操作是在自己建立的gulpfile-js文件中完成"><a href="#注意：所以任务的操作是在自己建立的gulpfile-js文件中完成" class="headerlink" title="注意：所以任务的操作是在自己建立的gulpfile.js文件中完成"></a>注意：所以任务的操作是在自己建立的gulpfile.js文件中完成</h3><script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/blog/about" rel="external nofollow noreferrer">LanHuiYan</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://codehouse9.gitee.io/blog/6327.html">http://codehouse9.gitee.io/blog/6327.html</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/blog/about" target="_blank">LanHuiYan</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/blog/tags/gulp/">
                                    <span class="chip bg-color">gulp</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/blog/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/blog/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/blog/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/blog/medias/reward/wechat.jpg" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/blog/5080.html">
                    <div class="card-image">
                        
                        
                        <img src="/blog/medias/featureimages/16.jpg" class="responsive-img" alt="解决因安装live2D看板娘导致不蒜子统计冲突">
                        
                        <span class="card-title">解决因安装live2D看板娘导致不蒜子统计冲突</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            问题描述我使用的是hexo采用的是mater主题；一开始不蒜子统计是有效果的，但是安装了live2D看板娘之后，统计信息就失效了。查看源码之后发现其隐藏起来了
解决方法
查找代码发现其所在的js文件是在主题文件下的：source\libs\
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-07-05
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/blog/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                    前端
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/blog/tags/live2D/">
                        <span class="chip bg-color">live2D</span>
                    </a>
                    
                    <a href="/blog/tags/hexo/">
                        <span class="chip bg-color">hexo</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/blog/a7d2.html">
                    <div class="card-image">
                        
                        
                        <img src="/blog/medias/featureimages/21.jpg" class="responsive-img" alt="Hexo超简单添加Live2D看板娘">
                        
                        <span class="card-title">Hexo超简单添加Live2D看板娘</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            安装live2D插件
安装命令cnpm i --save hexo-helper-live2d
live2D预览挑选自己喜欢的看板娘，复制她的名字地址：https://blog.csdn.net/wang_123_zy/article/de
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-07-05
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/blog/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                    前端
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/blog/tags/live2D/">
                        <span class="chip bg-color">live2D</span>
                    </a>
                    
                    <a href="/blog/tags/hexo/">
                        <span class="chip bg-color">hexo</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('500')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: codeHose9<br />'
            + '文章作者: LanHuiYan<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/blog/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/blog/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/blog/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/blog/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/blog/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/blog/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="503838841"
                   fixed='true'
                   autoplay='true'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.5'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/blog/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 15px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2020</span>
            <a href="/blog/about" target="_blank">LanHuiYan</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">42.8k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <span id="sitetime">载入运行时间...</span>
            <script>
                function siteTime() {
                    var seconds = 1000;
                    var minutes = seconds * 60;
                    var hours = minutes * 60;
                    var days = hours * 24;
                    var years = days * 365;
                    var today = new Date();
                    var startYear = "2020";
                    var startMonth = "6";
                    var startDate = "16";
                    var startHour = "0";
                    var startMinute = "0";
                    var startSecond = "0";
                    var todayYear = today.getFullYear();
                    var todayMonth = today.getMonth() + 1;
                    var todayDate = today.getDate();
                    var todayHour = today.getHours();
                    var todayMinute = today.getMinutes();
                    var todaySecond = today.getSeconds();
                    var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond);
                    var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
                    var diff = t2 - t1;
                    var diffYears = Math.floor(diff / years);
                    var diffDays = Math.floor((diff / days) - diffYears * 365);
                    var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours);
                    var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) /
                        minutes);
                    var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours -
                        diffMinutes * minutes) / seconds);
                    if (startYear == todayYear) {
                        document.getElementById("year").innerHTML = todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffDays + " 天 " + diffHours +
                            " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    } else {
                        document.getElementById("year").innerHTML = startYear + " - " + todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffYears + " 年 " + diffDays +
                            " 天 " + diffHours + " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    }
                }
                setInterval(siteTime, 1000);
            </script>
            
            <br>
            
            <span id="icp"><img src="/blog/medias/icp.png" style="vertical-align: text-bottom;" />
                <a href="http://www.beian.miit.gov.cn/" target="_blank">备案信息：赣ICP备20200706号-1</a>
            </span>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/codeHouse9/codeHouse9.github.io" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:3295849115@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=3295849115" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 3295849115" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>





    <a href="https://www.zhihu.com/people/wei-mi-de-xia-tian/asks" class="tooltipped" target="_blank" data-tooltip="关注我的知乎: https://www.zhihu.com/people/wei-mi-de-xia-tian/asks" data-position="top" data-delay="50">
        <i class="fab fa-zhihu1">知</i>
    </a>

<!-- 

    <a href="/blog/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>
 -->
</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/blog/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/blog/search.xml", 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/blog/libs/materialize/materialize.min.js"></script>
    <script src="/blog/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/blog/libs/aos/aos.js"></script>
    <script src="/blog/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/blog/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/blog/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/blog/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/blog/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    
    <script type="text/javascript" color="0,0,255"
        pointColor="0,0,255" opacity='0.7'
        zIndex="-1" count="66"
        src="/blog/libs/background/canvas-nest.js"></script>
    

    
    
    <script type="text/javascript" size="150" alpha='0.6'
        zIndex="-1" src="/blog/libs/background/ribbon-refresh.min.js" async="async"></script>
    

    
    <script type="text/javascript" src="/blog/libs/background/ribbon-dynamic.js" async="async"></script>
    

    
    <script src="/blog/libs/instantpage/instantpage.js" type="module"></script>
    

<script src="/blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/blog/live2dw/assets/shizuku.model.json"},"display":{"superSample":2,"width":150,"height":320,"position":"right","hOffset":50,"vOffset":-20},"mobile":{"show":false,"scale":0.8},"react":{"opacityDefault":0.7,"opacityOnHover":0.5},"log":false});</script></body>

</html>
